import math
import cmath

# print('hello world');

# a=1;
# while a==1:
#     print('a=',1)
#     a=2;
#     print('a被改变为：',a)


# if a==2:
#     print('a=',a)
#     a=99
# elif a==99:
#      print('a=',a)
#      a=1


# sum=0;
# a=1;
# while a<101:
#     sum+=a;
#     a+=1;
# else:
#     print('结束')
#     print('sum=',sum)
    
    
# while (a): print ('Given flag is really true!')




# for a in range(1,10):
#     # print(a)
#     for b in range(1,10):
#         print('a=',a,'b=',b)
#         if(b==3): 
#             print('3后面的流程自动结束')
#             break;
#     if(a==2):
#         print('跳过数字：',a)
#         continue;



# var1=12;
# var2=999;
# print('创建变量：a=',var1,'b=',var2)
# #清理变量
# del var1,var2
# print('被清理后的变量将无法使用：')         


# long=7979768768867868787687678;
# print(long)
# float=8.34343434
# print(float)

#复数与虚数
# z=3+3j;
# print(z)
# cp=complex(3,5.6)
# print(cp)



#类型转换
# a='123'
# aint=int(a)*99
# print(aint)
# strs=str(aint)
# print(strs)



#计算库
# 幂和对数
# print(math.exp(2))     # e^2 ≈ 7.389
# math.log(10)      # ln(10) ≈ 2.302
# math.log10(100)   # log10(100) = 2
# math.pow(2, 3)    # 2^3 = 8
# math.sqrt(25)     # √25 = 5

# # 三角函数（参数为弧度）
# math.sin(math.pi/2)  # sin(π/2) = 1
# math.cos(math.pi)    # cos(π) = -1
# math.tan(math.pi/4)  # tan(π/4) = 1

# # 反三角函数（返回弧度）
# math.asin(1)      # arcsin(1) = π/2
# math.acos(0)      # arccos(0) = π/2
# math.atan(1)      # arctan(1) = π/4

# math.pi     # π ≈ 3.141592653589793
# math.e      # 自然常数 e ≈ 2.718281828459045
# math.tau    # τ = 2π ≈ 6.283185307179586
# math.inf    # 无穷大
# math.nan    # 非数字

# math.sinh(0)     # 双曲正弦
# math.cosh(0)     # 双曲余弦
# math.tanh(0)     # 双曲正切



# #复数运算
# z = 3 + 4j

# # 模和相位角
# cmath.phase(z)    # 相位角（弧度）≈ 0.9273
# abs(z)            # 模 = 5 (cmath.abs 不存在，使用内置 abs())

# # 极坐标转换
# polar = cmath.polar(z)       # (模, 相位角) → (5.0, 0.9273)
# rect = cmath.rect(5, 0.9273) # 从极坐标转换 → (3+4j)

# # 指数和对数
# cmath.exp(z)      # e^(3+4j)
# cmath.log(z)      # ln(3+4j)
# cmath.log10(z)    # log10(3+4j)
# cmath.sqrt(z)     # √(3+4j) = 2+1j

# cmath.sin(z)      # 正弦
# cmath.cos(z)      # 余弦
# cmath.tan(z)      # 正切


# strs='hello world'
# print(strs[0])
# print(len(strs))
# print(strs.capitalize())




#列表
# list1 = ['physics', 'chemistry', 1997, 2000]
# print(list1)
# print(list1[2])
# print(list1[1:4])

# list1.append('新增元素')
# print(list1)

# list1.remove(2000)
# print(list1)

# del list1[0]
# print(list1)

# newlist=list1+list1
# print(newlist)


# newlist.reverse()
# print(newlist)





# #元组
# tup=(1,2,3,"345",'678')
# print(tup)
# print(tup[3])

# #任意无符号的对象，以逗号隔开，默认为元组
# print ('abc', -4.24e93, 18+6.6j, 'xyz')



#字典
# d={1:2,'hello':234}
# print(d)

# #获取
# print(d['hello'])

# #修改
# d['hello']='dggdf'
# print(d['hello'])

# #删除
# del d['hello'] 
# print(d)


# d['new']='新值'
# print(d)


# #不允许同一个键出现两次。创建时如果同一个键被赋值两次，后一个值会被记住
# tinydict = {'Name': 'Runoob', 'Age': 7, 'Name': 'Manni'} 
# print (tinydict)







